<%@page import="school.dao.test.StudentDaoTest"%>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ page import="school.dao.*" %>
<%@ page import="school.entity.*" %>
<%@ page import="java.lang.*" %>j
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'SearchStudent.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

  </head>
  
  <body>
   <%
   //out.print("123");
   MySqlStudentDaoImpl msd=new MySqlStudentDaoImpl();
   //在线注册新生(注意年级，直接用input文本框输入)，保存到数据库
   request.setCharacterEncoding("utf-8");
   int a=0;
   String stuno = request.getParameter("stuno");
   a=Integer.parseInt(stuno);
   //out.print(a);
   String name=request.getParameter("name");
   String sex=request.getParameter("sex");
   String tel=request.getParameter("tel");
   String qq=request.getParameter("qq");
   String wechat=request.getParameter("wechat");
   String enterdate=request.getParameter("start");
   String fromcity=request.getParameter("fromcity");
   String address=request.getParameter("address");
   String birthday=request.getParameter("birthday");
   String pass=request.getParameter("pass");
   String gradeid=request.getParameter("choose");
  Student s = new Student(a, tel, qq, name, sex, wechat, fromcity,
			address, pass, gradeid, enterdate, birthday);   
   out.print(s);
  msd.addStudent(s);
   out.print("注册成功！");
   %>
  </body>
</html>
